/**
 * 全局
 */
var Global = {
	/*
	 * echarts相关
	 */
	echarts: {
		// 隐藏
		hide: function(name) {
			name = name ? name : '南海诸岛';
			return {
				name: name,
				value: 0,
				tooltip: {show: false},
				itemStyle: {
					normal: {
						color: 'rgba(255,255,255,0)',
						label: {show: false}
					},
					emphasis: {
						color: 'rgba(255,255,255,0)',
						label: {show: false}
					}
				}
			};
		},
		// 将台湾和南海诸岛移到看不见的地方（经纬度调整）
		move: function() {
			return {'台湾': Global.GeoCoord['台湾'], '南海诸岛': Global.GeoCoord['南海诸岛']};
		}
	},
	// 公共url
	commonUrl: '/business/commonServlet',
	// 分割线（选中条件内容区分割线）
	splitLine: '<span style="font-weight: bold;padding: 0em 0.5em 0em 0.5em;">|</span>',
	// 最大可导出数据量
	exportMaxSize: 50000,
	// 云南中烟code
	ynInduCode: '20530001',
	// 红-同比
	colorRed: '#ff3333',
	// 深绿-同比
	colorDGreen: '#009545',
	//超链接颜色
	linkColor: '#0099ff',
	
	// 黑色-重要
	colorBlack: '#333333',
	// 浅黑色-一般
	colorLBlack: '#666666',
	// 灰色-辅助
	colorGray: '#999999',
	// 深灰-分割线
	colorDGray: '#dcdfe9',
	// 浅灰-背景
	colorLGray: '#eeeff3',
	
	// 深蓝
	colorDBlue: '#1490d1',
	// 浅蓝
	colorLBlue: '#0eb6b0',
		
	// 白色
	colorWhite: '#ffffff',
	
	// 图表颜色数组
	color: ['#60c0ea', '#acd878', '#ff9900', '#ef89b8', '#efc684', '#59d1ba', 'green'],
	// 阀值（三段绿、黄、红颜色数组）
	thrshdColor: ['#8bbf3a','#ffff00','#ff0000'],
	// 曲线图series公共样式
	lineSeriesStyle: {
		type: 'line',
		smooth: true,// 是否平滑显示
		symbol: 'emptyCircle',
		symbolSize: 3,
		itemStyle: {
			normal: {
				lineStyle: {
					width: 3
				}
			}
		},
		data: ['-']
	},
	// 图表线线条样式
	lineStyle: {
		color: '#dcdfe9',
		width: 1
	},
	// 图表字体样式
	textStyle: {
		color: '#999999',
		fontSize: 12
	},
	// 饼图透明填充
	piePlaceHolderStyle: {
		normal: {
	        color: 'rgba(0,0,0,0.05)',
	        label: {show: false},
	        labelLine: {show: false}
	    },
	    emphasis: {
	        color: 'rgba(0,0,0,0.05)'
	    }
	},
	Cache: {
		// 产品与市场（product market）-零售终端（retail terminal）
		// 零售户跟踪（retailer track）-cache key
		PM_RT_RETAILER_TRACK_CACHE_KEY: 'PM_RT_Retailer_Track_Cache'
	},
	/**
	 * 服务(缓存)key
	 * 表格导出时使用
	 */
	ServerKey: {
		// 总体态势分析
		OvrlSitnAnls: {
			lt: 'TOTALPRICEAREA',// 批发价区销售分析
			lm: 'TOTALPRICECLASS',// 卷烟类别销售分析
			rt: 'TOTALPRICEAREALINE',// 批发价区成长性分析
			rm: 'TOTALPRICECLASSLINE'// 价类成长性分析
		},
		// 品牌分析
		CigAnls: {
			lt: 'CIG',// 品牌竞争关系
			lm: 'CIGMARKET',// 品牌市场分析
			rt: 'CIGGROW'//品牌成长性分析 
		},
		// 产品分析
		ProdAnls: {
			lt: 'MAINCIG',// 卷烟规格竞争关系
			lm: 'MARKET',// 竞争市场格局
			lb: 'MAINBRANDMARKET',// 卷烟规格市场格局
			rt: 'PRICESELL',// 卷烟规格成长性分析
			rm: 'BUSLINE'// 卷烟规格市场分析
		}
	}
	// 无数据省份数据源
	,emptyDataProvinceDs: function() {
		return {'北京': {name: '北京',value: -1},'天津': {name: '天津',value: -1},'河北': {name: '河北',value: -1},
			'山西': {name: '山西',value: -1},'内蒙古': {name: '内蒙古',value: -1},'辽宁': {name: '辽宁',value: -1},
			'吉林': {name: '吉林',value: -1},'黑龙江': {name: '黑龙江',value: -1},'上海': {name: '上海',value: -1},
			'江苏': {name: '江苏',value: -1},'浙江': {name: '浙江',value: -1},'安徽': {name: '安徽',value: -1},
			'福建': {name: '福建',value: -1},'江西': {name: '江西',value: -1},'山东': {name: '山东',value: -1},
			'河南': {name: '河南',value: -1},'湖北': {name: '湖北',value: -1},'湖南': {name: '湖南',value: -1},
			'广东': {name: '广东',value: -1},'广西': {name: '广西',value: -1},'海南': {name: '海南',value: -1},
			'重庆': {name: '重庆',value: -1},'四川': {name: '四川',value: -1},'贵州': {name: '贵州',value: -1},
			'云南': {name: '云南',value: -1},'西藏': {name: '西藏',value: -1},'陕西': {name: '陕西',value: -1},
			'甘肃': {name: '甘肃',value: -1},'青海': {name: '青海',value: -1},'宁夏': {name: '宁夏',value: -1},
			'新疆': {name: '新疆',value: -1}};
	}
	// 省份
	,Province: {
		110000: '北京',120000: '天津',130000: '河北',140000: '山西',150000: '内蒙古',210000: '辽宁',220000: '吉林',
		230000: '黑龙江',310000: '上海',320000: '江苏',330000: '浙江',340000: '安徽',350000: '福建',360000: '江西',
		370000: '山东',410000: '河南',420000: '湖北',430000: '湖南',440000: '广东',450000: '广西',460000: '海南',
		500000: '重庆',510000: '四川',520000: '贵州',530000: '云南',540000: '西藏',610000: '陕西',620000: '甘肃',
		630000: '青海',640000: '宁夏',650000: '新疆'
	}
	// 城市
	,City: {
		110000: '北京市',120000: '天津市',310000: '上海市',500000: '重庆市',
		
		130100: '石家庄市',130200: '唐山市',130300: '秦皇岛市',130400: '邯郸市',130500: '邢台市',130600: '保定市',
		130700: '张家口市',130800: '承德市',130900: '沧州市',131000: '廊坊市',131100: '衡水市',
		
		140100: '太原市',140200: '大同市',140300: '阳泉市',140400: '长治市',140500: '晋城市',140600: '朔州市',
		140700: '晋中市',140800: '运城市',140900: '忻州市',141000: '临汾市',141100: '吕梁市',
		
		150100: '呼和浩特市',150200: '包头市',150300: '乌海市',150400: '赤峰市',150500: '通辽市',150600: '鄂尔多斯市',150700: '呼伦贝尔市',
		150800: '巴彦淖尔市',150900: '乌兰察布市',152200: '兴安盟',152500: '锡林郭勒盟',152900: '阿拉善盟',

		210100: '沈阳市',210300: '鞍山市',210400: '抚顺市',210500: '本溪市',210600: '丹东市',210700: '锦州市',210800: '营口市',
		210900: '阜新市',211000: '辽阳市',211100: '盘锦市',211200: '铁岭市',211300: '朝阳市',211400: '葫芦岛市',210200: '大连市',

		220100: '长春市',220200: '吉林市',220300: '四平市',220400: '辽源市',220500: '通化市',220600: '白山市',220700: '松原市',220800: '白城市',222400: '延边朝鲜族自治州',

		230100: '哈尔滨市',230200: '齐齐哈尔市',230300: '鸡西市',230400: '鹤岗市',230500: '双鸭山市',230600: '大庆市',230700: '伊春市',
		230800: '佳木斯市',230900: '七台河市',231000: '牡丹江市',231100: '黑河市',231200: '绥化市',232700: '大兴安岭地区',
			
		320100: '南京市',320200: '无锡市',320300: '徐州市',320400: '常州市',320500: '苏州市',320600: '南通市',320700: '连云港市',
		320800: '淮安市',320900: '盐城市',321000: '扬州市',321100: '镇江市',321200: '泰州市',321300: '宿迁市',
		
		330100: '杭州市',330200: '宁波市',330300: '温州市',330400: '嘉兴市',330500: '湖州市',330600: '绍兴市',330700: '金华市',330800: '衢州市',
		330900: '舟山市',331000: '台州市',331100: '丽水市',

		340100: '合肥市',340200: '芜湖市',340300: '蚌埠市',340400: '淮南市',340500: '马鞍山市',340600: '淮北市',340700: '铜陵市',340800: '安庆市',
		341000: '黄山市',341100: '滁州市',341200: '阜阳市',341300: '宿州市',341500: '六安市',341600: '亳州市',341700: '池州市',341800: '宣城市',
		
		350100: '福州市',350200: '厦门市',350300: '莆田市',350400: '三明市',350500: '泉州市',350600: '漳州市',350700: '南平市',350800: '龙岩市',350900: '宁德市',
		
		360100: '南昌市',360200: '景德镇市',360300: '萍乡市',360400: '九江市',360500: '新余市',360600: '鹰潭市',360700: '赣州市',
		360800: '吉安市',360900: '宜春市',361000: '抚州市',361100: '上饶市',
		
		370100: '济南市',370200: '青岛市',370300: '淄博市',370400: '枣庄市',370500: '东营市',370600: '烟台市',370700: '潍坊市',370800: '济宁市',370900: '泰安市',
		371000: '威海市',371100: '日照市',371200: '莱芜市',371300: '临沂市',371400: '德州市',371500: '聊城市',371600: '滨州市',371700: '荷泽市',
		
		410100: '郑州市',410200: '开封市',410300: '洛阳市',410400: '平顶山市',410500: '安阳市',410600: '鹤壁市',410700: '新乡市',410800: '焦作市',410881: '济源市',
		410900: '濮阳市',411000: '许昌市',411100: '漯河市',411200: '三门峡市',411300: '南阳市',411400: '商丘市',411500: '信阳市',411600: '周口市',411700: '驻马店市',
		
		420100: '武汉市',420200: '黄石市',420300: '十堰市',420500: '宜昌市',420600: '襄樊市',420700: '鄂州市',	420800: '荆门市',420900: '孝感市',421000: '荆州市',
		421100: '黄冈市',421200: '咸宁市',421300: '随州市',422800: '恩施土族苗族自治州',429004: '仙桃市',429005: '潜江市',429006: '天门市',429021: '神农架林区',

		430100: '长沙市',430200: '株洲市',430300: '湘潭市',430400: '衡阳市',430500: '邵阳市',430600: '岳阳市',430700: '常德市',430800: '张家界市',
		430900: '益阳市',431000: '郴州市',431100: '永州市',431200: '怀化市',431300: '娄底市',433100: '湘西土家族苗族自治州',

		440100: '广州市',440200: '韶关市',440300: '深圳市',440400: '珠海市',440500: '汕头市',440600: '佛山市',440700: '江门市',
		440800: '湛江市',440900: '茂名市',441200: '肇庆市',441300: '惠州市',441400: '梅州市',441500: '汕尾市',441600: '河源市',
		441700: '阳江市',441800: '清远市',441900: '东莞市',442000: '中山市',445100: '潮州市',445200: '揭阳市',445300: '云浮市',
		
		450100: '南宁市',450200: '柳州市',450300: '桂林市',450400: '梧州市',450500: '北海市',450600: '防城港市',450700: '钦州市',
		450800: '贵港市',450900: '玉林市',451000: '百色市',451100: '贺州市',451200: '河池市',451300: '来宾市',451400: '崇左市',
		
		460100: '海口市',460200: '三亚市',469002: '琼海市',469003: '儋州市',460000:'海南',
		
		510100: '成都市',510300: '自贡市',510400: '攀枝花市',510500: '泸州市',510600: '德阳市',510700: '绵阳市',510800: '广元市',510900: '遂宁市',	
		511000: '内江市',511100: '乐山市',511300: '南充市',511400: '眉山市',511500: '宜宾市',	511600: '广安市',511700: '达州市',
		511800: '雅安市',511900: '巴中市',512000: '资阳市',513200: '阿坝藏族羌族自治州',513300: '甘孜藏族自治州',513400: '凉山彝族自治州',
		
		520100: '贵阳市',520200: '六盘水市',520300: '遵义市',520400: '安顺市',522200: '铜仁地区',522300: '黔西南布依族苗族自治',522400: '毕节地区',
		522600: '黔东南苗族侗族自治州',522700: '黔南布依族苗族自治州',
		
		530100: '昆明市',530300: '曲靖市',530400: '玉溪市',530500: '保山市',530600: '昭通市',530700: '丽江市',530800: '普洱市',530900: '临沧市',			
		532300: '楚雄彝族自治州',532500: '红河哈尼族彝族自治州',532600: '文山壮族苗族自治州',532800: '西双版纳傣族自治州',
		532900: '大理白族自治州',533100: '德宏傣族景颇族自治州',533300: '怒江傈僳族自治州',533400: '迪庆藏族自治州', 
		
		540100: '拉萨市',542100: '昌都地区',542200: '山南地区',542300: '日喀则地区',542400: '那曲地区',542500: '阿里地区',542600: '林芝地区',
		
		610100: '西安市',610200: '铜川市',610300: '宝鸡市',610400: '咸阳市',610500: '渭南市',
		610600: '延安市',610700: '汉中市',610800: '榆林市',610900: '安康市',611000: '商洛市',
		
		620100: '兰州市',620200: '嘉峪关市',620300: '金昌市',620400: '白银市',620500: '天水市',620600: '武威市',620700: '张掖市',620800: '平凉市',
		620900: '酒泉市',621000: '庆阳市',621100: '定西市',622600: '陇南地区',622901: '临夏市',623000: '甘南藏族自治州',
		
		630100: '西宁市',632100: '海东地区',632200: '海北藏族自治州',632300: '黄南藏族自治州',632500: '海南藏族自治州',
		632600: '果洛藏族自治州',632700: '玉树藏族自治州',632800: '海西蒙古族藏族自治州',630000:'青海省',
		
		640100: '银川市',640200: '石嘴山市',640300: '吴忠市',640400: '固原市',640500: '中卫市',
		
		650100: '乌鲁木齐市',650200: '克拉玛依市',652100: '吐鲁番地区',652200: '哈密地区',652300: '昌吉回族自治州',
		652700: '博尔塔拉蒙古自治州',652800: '巴音郭楞蒙古自治州',652900: '阿克苏地区',653000: '克孜勒苏柯尔克孜自治',
		653100: '喀什地区',653200: '和田地区',654000: '伊犁哈萨克自治州',654200: '塔城地区',654300: '阿勒泰地区',659001: '石河子市',650000:'新疆'
	},
	// 地理坐标（经度/纬度）
	GeoCoord: {
		'china':{
			'新疆': [84.9023,41.748],'西藏': [88.7695,31.6846],'内蒙古': [117.5977,44.3408],'青海': [96.2402,35.4199],
			'四川': [102.9199,30.1904],'黑龙江': [128.1445,48.5156],'甘肃': [95.7129,40.166],'云南': [101.8652,25.1807],
			'广西': [108.2813,23.6426],'湖南': [111.5332,27.3779],'陕西': [109.5996,35.6396],'广东': [113.4668,22.8076],
			'吉林': [126.4746,43.5938],'河北': [115.4004,37.9688],'湖北': [112.2363,31.1572],'贵州': [106.6113,26.9385],
			'山东': [118.7402,36.4307],'江西': [116.0156,27.29],'河南': [113.4668,33.8818],'辽宁': [122.3438,41.0889],
			'山西': [112.4121,37.6611],'安徽': [117.2461,32.0361],'福建': [118.3008,25.9277],'浙江': [120.498,29.0918],
			'江苏': [120.0586,32.915],'重庆': [107.7539,30.1904],'宁夏': [105.9961,37.3096],'海南': [109.9512,19.2041],
			'北京': [116.4551,40.2539],'天津': [117.4219,39.4189],'上海': [121.4648,31.2891],'香港': [114.2578,22.3242],
			'澳门': [113.5547,22.1484],'深圳市': [114.5435,22.5439],'大连市': [122.2229,39.4409],
			'台湾': [170,30],'南海诸岛': [170,30]},
		'台湾': [170,30],'南海诸岛': [170,30],
		'北京': {'密云县': [117.0923,40.5121],'怀柔区': [116.6377,40.6219],'房山区': [115.8453,39.7163],'延庆县': [116.1543,40.5286],
				'门头沟区': [115.8,39.9957],'昌平区': [116.1777,40.2134],'大兴区': [116.4716,39.6352],'顺义区': [116.7242,40.1619],
				'平谷区': [117.1706,40.2052],'通州区': [116.7297,39.8131],'朝阳区': [116.4977,39.949],'海淀区': [116.2202,40.0239],
				'丰台区': [116.2683,39.8309],'石景山区': [116.1887,39.9346],'西城区': [116.3631,39.9353],'东城区': [116.418,39.9367],
				'宣武区': [116.3603,39.8852],'崇文区': [116.4166,39.8811]},
		'天津': {'蓟县': [117.4672,40.004],'武清区': [117.0621,39.4121],'宝坻区': [117.4274,39.5913],'静海县': [116.9824,38.8312],
				'宁河县': [117.6801,39.3853],'大港区': [117.3875,38.757],'塘沽区': [117.6801,38.9987],'西青区': [117.1829,39.0022],
				'北辰区': [117.1761,39.2548],'东丽区': [117.4013,39.1223],'汉沽区': [117.8888,39.2191],'津南区': [117.3958,38.9603],
				'河西区': [117.2365,39.0804],'河东区': [117.2571,39.1209],'南开区': [117.1527,39.1065],'河北区': [117.2145,39.1615],
				'红桥区': [117.1596,39.1663],'和平区': [117.2008,39.1189]},
		'河北': {'承德市': [117.5757,41.4075],'张家口市': [115.1477,40.8527],'保定市': [115.0488,39.0948],'唐山市': [118.4766,39.6826],
				'沧州市': [116.8286,38.2104],'石家庄市': [114.4995,38.1006],'邢台市': [114.8071,37.2821],'邯郸市': [114.4775,36.535],
				'秦皇岛市': [119.2126,40.0232],'衡水市': [115.8838,37.7161],'廊坊市': [116.521,39.0509]},
		'山西': {'忻州市': [112.4561,38.8971],'吕梁市': [111.3574,37.7325],'临汾市': [111.4783,36.1615],'晋中市': [112.7747,37.37],
				'运城市': [111.1487,35.2002],'大同市': [113.7854,39.8035],'长治市': [112.8625,36.4746],'朔州市': [113.0713,39.6991],
				'晋城市': [112.7856,35.6342],'太原市': [112.3352,37.9413],'阳泉市': [113.4778,38.0951]},
		'内蒙古': {'呼伦贝尔市': [120.8057,50.2185],'阿拉善盟': [102.019,40.1001],'锡林郭勒盟': [115.6421,44.176],'鄂尔多斯市': [108.9734,39.2487],
				'赤峰市': [118.6743,43.2642],'巴彦淖尔市': [107.5562,41.3196],'通辽市': [121.4758,43.9673],'乌兰察布市': [112.5769,41.77],
				'兴安盟': [121.3879,46.1426],'包头市': [110.3467,41.4899],'呼和浩特市': [111.4124,40.4901],'乌海市': [106.886,39.4739]},
		'辽宁': {'大连市': [122.2229,39.4409],'朝阳市': [120.0696,41.4899],'丹东市': [124.541,40.4242],'铁岭市': [124.2773,42.7423],
				'沈阳市': [123.1238,42.1216],'抚顺市': [124.585,41.8579],'葫芦岛市': [120.1575,40.578],'阜新市': [122.0032,42.2699],
				'锦州市': [121.6626,41.4294],'鞍山市': [123.0798,40.6055],'本溪市': [124.1455,41.1987],'营口市': [122.4316,40.4297],
				'辽阳市': [123.4094,41.1383],'盘锦市': [121.9482,41.0449]},
		'吉林': {'延边朝鲜族自治州': [129.397,43.2587],'吉林市': [126.8372,43.6047],'白城市': [123.0029,45.2637],'松原市': [124.0906,44.7198],
				'长春市': [125.8154,44.2584],'白山市': [127.2217,42.0941],'通化市': [125.9583,41.8579],'四平市': [124.541,43.4894],
				'辽源市': [125.343,42.7643]},
		'黑龙江': {'黑河市': [127.1448,49.2957],'大兴安岭地区': [124.1016,52.2345],'哈尔滨市': [127.9688,45.368],'齐齐哈尔市': [124.541,47.5818],
				'牡丹江市': [129.7815,44.7089],'绥化市': [126.7163,46.8018],'伊春市': [129.1992,47.9608],'佳木斯市': [133.0005,47.5763],
				'鸡西市': [132.7917,45.7361],'双鸭山市': [133.5938,46.7523],'大庆市': [124.7717,46.4282],'鹤岗市': [130.4407,47.7081],
				'七台河市': [131.2756,45.9558]},
		'上海': {'崇明县': [121.5637,31.5383],'南汇区': [121.8755,30.954],'奉贤区': [121.5747,30.8475],'浦东新区': [121.6928,31.2561],
				'金山区': [121.2657,30.8112],'青浦区': [121.1751,31.1909],'松江区': [121.1984,31.0268],'嘉定区': [121.2437,31.3625],
				'宝山区': [121.4346,31.4051],'闵行区': [121.4992,31.0838],'杨浦区': [121.528,31.2966],'普陀区': [121.3879,31.2602],
				'徐汇区': [121.4333,31.1607],'长宁区': [121.3852,31.2115],'闸北区': [121.4511,31.2794],'虹口区': [121.4882,31.2788],
				'黄浦区': [121.4868,31.219],'卢湾区': [121.4758,31.2074],'静安区': [121.4484,31.2286]},
		'江苏': {'盐城市': [120.2234,33.5577],'徐州市': [117.5208,34.3268],'南通市': [121.1023,32.1625],'淮安市': [118.927,33.4039],
				'苏州市': [120.6519,31.3989],'宿迁市': [118.5535,33.7775],'连云港市': [119.1248,34.552],'扬州市': [119.4653,32.8162],
				'南京市': [118.8062,31.9208],'泰州市': [120.0586,32.5525],'无锡市': [120.3442,31.5527],'常州市': [119.4543,31.5582],
				'镇江市': [119.4763,31.9702]},
		'浙江': {'丽水市': [119.5642,28.1854],'杭州市': [119.5313,29.8773],'温州市': [120.498,27.8119],'宁波市': [121.5967,29.6466],
				'舟山市': [122.2559,30.2234],'台州市': [121.1353,28.6688],'金华市': [120.0037,29.1028],'衢州市': [118.6853,28.8666],
				'绍兴市': [120.564,29.7565],'嘉兴市': [120.9155,30.6354],'湖州市': [119.8608,30.7782]},
		'安徽': {'六安市': [116.3123,31.8329],'安庆市': [116.7517,30.5255],'滁州市': [118.1909,32.536],'宣城市': [118.8062,30.6244],
				'阜阳市': [115.7629,32.9919],'宿州市': [117.5208,33.6841],'黄山市': [118.0481,29.9542],'巢湖市': [117.7734,31.4978],
				'亳州市': [116.1914,33.4698],'池州市': [117.3889,30.2014],'合肥市': [117.29,32.0581],'蚌埠市': [117.4109,33.1073],
				'芜湖市': [118.3557,31.0858],'淮北市': [116.6968,33.6896],'淮南市': [116.7847,32.7722],'马鞍山市': [118.6304,31.5363],
				'铜陵市': [117.9382,30.9375]},
		'福建': {'南平市': [118.136,27.2845],'三明市': [117.5317,26.3013],'龙岩市': [116.8066,25.2026],'宁德市': [119.6521,26.9824],
				'福州市': [119.4543,25.9222],'漳州市': [117.5757,24.3732],'泉州市': [118.3228,25.1147],'莆田市': [119.0918,25.3455],
				'厦门市': [118.1689,24.6478]},
		'江西': {'赣州市': [115.2795,25.8124],'吉安市': [114.884,26.9659],'上饶市': [117.8613,28.7292],'九江市': [115.4224,29.3774],
				'抚州市': [116.4441,27.4933],'宜春市': [115.0159,28.3228],'南昌市': [116.0046,28.6633],'景德镇市': [117.334,29.3225],
				'萍乡市': [113.9282,27.4823],'鹰潭市': [117.0813,28.2349],'新余市': [114.95,27.8174]},
		'山东': {'烟台市': [120.7397,37.5128],'临沂市': [118.3118,35.2936],'潍坊市': [119.0918,36.524],'青岛市': [120.4651,36.3373],
				'菏泽市': [115.6201,35.2057],'济宁市': [116.8286,35.3375],'德州市': [116.6858,37.2107],'滨州市': [117.8174,37.4963],
				'聊城市': [115.9167,36.4032],'东营市': [118.7073,37.5513],'济南市': [117.1582,36.8701],'泰安市': [117.0264,36.0516],
				'威海市': [121.9482,37.1393],'日照市': [119.2786,35.5023],'淄博市': [118.0371,36.6064],'枣庄市': [117.323,34.8926],
				'莱芜市': [117.6526,36.2714]},
		'河南': {'南阳市': [112.4011,33.0359],'信阳市': [114.8291,32.0197],'洛阳市': [112.0605,34.3158],'驻马店市': [114.1589,32.9041],
				'周口市': [114.873,33.6951],'商丘市': [115.741,34.2828],'三门峡市': [110.8301,34.3158],'新乡市': [114.2029,35.3595],
				'平顶山市': [112.9724,33.739],'郑州市': [113.4668,34.6234],'安阳市': [114.5325,36.0022],'开封市': [114.5764,34.6124],
				'焦作市': [112.8406,35.1508],'许昌市': [113.6975,34.0466],'濮阳市': [115.1917,35.799],'漯河市': [113.8733,33.6951],
				'鹤壁市': [114.3787,35.744]},
		'湖北': {'恩施土家族苗族自治州': [109.5007,30.2563],'十堰市': [110.5115,32.3877],'宜昌市': [111.1707,30.7617],'襄樊市': [111.9397,31.9263],
				'黄冈市': [115.2686,30.6628],'荆州市': [113.291,30.0092],'荆门市': [112.6758,30.9979],'咸宁市': [114.2578,29.6631],
				'随州市': [113.4338,31.8768],'孝感市': [113.9502,31.1188],'武汉市': [114.3896,30.6628],'黄石市': [115.0159,29.9213],
				'神农架林区': [110.4565,31.5802],'天门市': [113.0273,30.6409],'仙桃市': [113.3789,30.3003],'潜江市': [112.7637,30.3607],
				'鄂州市': [114.7302,30.4102]},
		'湖南': {'怀化市': [109.9512,27.4438],'永州市': [111.709,25.752],'邵阳市': [110.9619,26.8121],'郴州市': [113.2361,25.8673],
				'常德市': [111.4014,29.2676],'湘西土家族苗族自治州': [109.7864,28.6743],'衡阳市': [112.4121,26.7902],'岳阳市': [113.2361,29.1357],
				'益阳市': [111.731,28.3832],'长沙市': [113.0823,28.2568],'株洲市': [113.5327,27.0319],'张家界市': [110.5115,29.328],
				'娄底市': [111.6431,27.7185],'湘潭市': [112.5439,27.7075]},
		'广东': {'清远市': [112.9175,24.3292],'韶关市': [113.7964,24.7028],'湛江市': [110.3577,20.9894],'梅州市': [116.1255,24.1534],
				'河源市': [114.917,23.9722],'肇庆市': [112.1265,23.5822],'惠州市': [114.6204,23.1647],'茂名市': [111.0059,22.0221],
				'江门市': [112.6318,22.1484],'阳江市': [111.8298,22.0715],'云浮市': [111.7859,22.8516],'广州市': [113.5107,23.2196],
				'汕尾市': [115.5762,23.0438],'揭阳市': [116.1255,23.313],'珠海市': [113.7305,22.1155],'佛山市': [112.8955,23.1097],
				'潮州市': [116.7847,23.8293],'汕头市': [117.1692,23.3405],'深圳市': [114.5435,22.5439],'东莞市': [113.8953,22.901],
				'中山市': [113.4229,22.478]},	
		'广西': {'百色市': [106.6003,23.9227],'河池市': [107.8638,24.5819],'桂林市': [110.5554,25.318],'南宁市': [108.479,23.1152],
				'柳州市': [109.3799,24.9774],'崇左市': [107.3364,22.4725],'来宾市': [109.7095,23.8403],'玉林市': [110.2148,22.3792],
				'梧州市': [110.9949,23.5052],'贺州市': [111.3135,24.4006],'钦州市': [109.0283,22.0935],'贵港市': [109.9402,23.3459],
				'防城港市': [108.0505,21.9287],'北海市': [109.314,21.6211]},
		'海南': {'儋州市': [109.3291,19.5653],'文昌市': [110.8905,19.7823],'乐东黎族自治县': [109.0283,18.6301],'三亚市': [109.3716,18.3698],
				'琼中黎族苗族自治县': [109.8413,19.0736],'东方市': [108.8498,19.0414],'海口市': [110.3893,19.8516],'万宁市': [110.3137,18.8388],
				'澄迈县': [109.9937,19.7314],'白沙黎族自治县': [109.3703,19.211],'琼海市': [110.4208,19.224],'昌江黎族自治县': [109.0407,19.2137],
				'临高县': [109.6957,19.8063],'陵水黎族自治县': [109.9924,18.5415],'屯昌县': [110.0377,19.362],'定安县': [110.3384,19.4698],
				'保亭黎族苗族自治县': [109.6284,18.6108],'五指山市': [109.5282,18.8299]},
		'重庆': {'酉阳土家族苗族自治县': [108.8196,28.8666],'奉节县': [109.3909,30.9265],'巫溪县': [109.3359,31.4813],'开县': [108.4131,31.2561],
				'彭水苗族土家族自治县': [108.2043,29.3994],'云阳县': [108.8306,31.0089],'万州区': [108.3911,30.6958],'城口县': [108.7756,31.9098],
				'江津区': [106.2158,28.9874],'石柱土家族自治县': [108.2813,30.1025],'巫山县': [109.8853,31.1188],'涪陵区': [107.3364,29.6796],
				'丰都县': [107.8418,29.9048],'武隆县': [107.655,29.35],'南川区': [107.1716,29.1302],'秀山土家族苗族自治县': [109.0173,28.5205],
				'黔江区': [108.7207,29.4708],'合川区': [106.3257,30.108],'綦江县': [106.6553,28.8171],'忠县': [107.8967,30.3223],
				'梁平县': [107.7429,30.6519],'巴南区': [106.7322,29.4214],'潼南县': [105.7764,30.1135],'永川区': [105.8643,29.2566],
				'垫江县': [107.4573,30.2454],'渝北区': [106.7212,29.8499],'长寿区': [107.1606,29.9762],'大足县': [105.7544,29.6136],
				'铜梁县': [106.0291,29.8059],'荣昌县': [105.5127,29.4708],'璧山县': [106.2048,29.5807],'北碚区': [106.5674,29.8883],
				'万盛区': [106.908,28.9325],'九龙坡区': [106.3586,29.4049],'沙坪坝区': [106.3696,29.6191],'南岸区': [106.6663,29.5367],
				'江北区': [106.8311,29.6191],'大渡口区': [106.4905,29.4214],'双桥区': [105.7874,29.4928],'渝中区': [106.5344,29.5477]},
		'四川': {'甘孜藏族自治州': [99.9207,31.0803],'阿坝藏族羌族自治州': [102.4805,32.4536],'凉山彝族自治州': [101.9641,27.6746],
				'绵阳市': [104.7327,31.8713],'达州市': [107.6111,31.333],'广元市': [105.6885,32.2284],'雅安市': [102.6672,29.8938],
				'宜宾市': [104.6558,28.548],'乐山市': [103.5791,29.1742],'南充市': [106.2048,31.1517],'巴中市': [107.0618,31.9977],
				'泸州市': [105.4578,28.493],'成都市': [103.9526,30.7617],'资阳市': [104.9744,30.1575],'攀枝花市': [101.6895,26.7133],
				'眉山市': [103.8098,30.0146],'广安市': [106.6333,30.4376],'德阳市': [104.48,31.1133],'内江市': [104.8535,29.6136],
				'遂宁市': [105.5347,30.6683],'自贡市': [104.6667,29.2786]},
		'贵州': {'遵义市': [106.908,28.1744],'黔东南苗族侗族自治州': [108.4241,26.4166],'毕节地区': [105.1611,27.0648],
				'黔南布依族苗族自治州': [107.2485,25.8398],'铜仁地区': [108.6218,28.0096],'黔西南布依族苗族自治州': [105.5347,25.3949],
				'六盘水市': [104.7546,26.0925],'安顺市': [105.9082,25.9882],'贵阳市': [106.6992,26.7682]},
		'云南': {'普洱市': [100.7446,23.4229],'红河哈尼族彝族自治州': [103.0408,23.6041],'文山壮族苗族自治州': [104.8865,23.5712],
				'曲靖市': [103.9417,25.7025],'楚雄彝族自治州': [101.6016,25.3619],'大理白族自治州': [99.9536,25.6805],'临沧市': [99.613,24.0546],
				'迪庆藏族自治州': [99.4592,27.9327],'昭通市': [104.0955,27.6031],'昆明市': [102.9199,25.4663],'丽江市': [100.448,26.955],
				'西双版纳傣族自治州': [100.8984,21.8628],'保山市': [99.0637,24.9884],'玉溪市': [101.9312,23.8898],
				'怒江傈僳族自治州': [99.1516,26.5594],'德宏傣族景颇族自治州': [98.1299,24.5874]},
		'西藏': {'那曲地区': [88.1982,33.3215],'阿里地区': [82.3645,32.7667],'日喀则地区': [86.2427,29.5093],'林芝地区': [95.4602,29.1138],
				'昌都地区': [97.0203,30.7068],'山南地区': [92.2083,28.3392],'拉萨市': [91.1865,30.1465]},
		'陕西': {'榆林市': [109.8743,38.205],'延安市': [109.1052,36.4252],'汉中市': [106.886,33.0139],'安康市': [109.1162,32.7722],
				'商洛市': [109.8083,33.761],'宝鸡市': [107.1826,34.3433],'渭南市': [109.7864,35.0299],'咸阳市': [108.4131,34.8706],
				'西安市': [109.1162,34.2004],'铜川市': [109.0393,35.1947]},
		'甘肃': {'酒泉市': [96.2622,40.4517],'张掖市': [99.7998,38.7433],'甘南藏族自治州': [102.9199,34.6893],'武威市': [103.0188,38.1061],
				'陇南市': [105.304,33.5632],'庆阳市': [107.5342,36.2],'白银市': [104.8645,36.5076],'定西市': [104.5569,35.0848],
				'天水市': [105.6445,34.6289],'兰州市': [103.5901,36.3043],'平凉市': [107.0728,35.321],'临夏回族自治州': [103.2715,35.5737],
				'金昌市': [102.074,38.5126],'嘉峪关市': [98.1738,39.8035]},
		'青海': {'海西蒙古族藏族自治州': [94.9768,37.1118],'玉树藏族自治州': [93.5925,33.9368],'果洛藏族自治州': [99.3823,34.0466],
				'海南藏族自治州': [100.3711,35.9418],'海北藏族自治州': [100.3711,37.9138],'黄南藏族自治州': [101.5686,35.1178],
				'海东地区': [102.3706,36.2988],'西宁市': [101.4038,36.8207]},
		'宁夏': {'吴忠市': [106.853,37.3755],'中卫市': [105.4028,36.9525],'固原市': [106.1389,35.9363],'银川市': [106.3586,38.1775],
				'石嘴山市': [106.4795,39.0015]},
		'新疆': {'巴音郭楞蒙古自治州': [88.1653,39.6002],'和田地区': [81.167,36.9855],'哈密地区': [93.7793,42.9236],'阿克苏地区': [82.9797,41.0229],
				'阿勒泰地区': [88.2971,47.0929],'喀什地区': [77.168,37.8534],'塔城地区': [86.6272,45.8514],'昌吉回族自治州': [89.6814,44.4507],
				'克孜勒苏柯尔克孜自治州': [74.6301,39.5233],'吐鲁番地区': [89.6375,42.4127],'伊犁哈萨克自治州': [82.5513,43.5498],
				'博尔塔拉蒙古自治州': [81.8481,44.6979],'乌鲁木齐市': [87.9236,43.5883],'克拉玛依市': [85.2869,45.5054],'阿拉尔市': [81.2769,40.6549],
				'图木舒克市': [79.1345,39.8749],'五家渠市': [87.5391,44.3024],'石河子市': [86.0229,44.2914]}
	}
};
/**
 * 参数
 */
var Param = {
	CMDKEY: 'cmd',// command key
	CMDTYPEKEY: 'cmdType',// command type key
	CMDVALUEKEY: 'cmdValue',// command value key
	PARAMJSONKEY: 'paramJson',// param json key
	EXCELEXPIDKEY: 'rns',// excel export param json id key
	CREATE: 1,// 新增/添加
	READ: 2,// 查询
	UPDATE: 3,// 修改/编辑/更新
	DELETE: 4,// 删除/移除
	LOAD: 5,// 加载
	EXPORT: 6,// 导出
	IMPORT: 7,// 导入
	// 分页相关
	PAGE: 'page',
	PAGE_SIZE: 'rows',
	SORT_FIELD: 'sortField',
	SORT_DIRECTION: 'sortDirection',
	SERVER_KEY: 'serverKey',
	// sql数据类型(java.sql.Types类)
	SQLType: {
		BIT: -7,TINYINT: -6,SMALLINT: 5,INTEGER: 4,BIGINT: -5,FLOAT: 6,REAL: 7,
		DOUBLE: 8,NUMERIC: 2,DECIMAL: 3,CHAR: 1,VARCHAR: 12,LONGVARCHAR: -1,
		DATE: 91,TIME: 92,TIMESTAM: 93,BINARY: -2,VARBINARY: -3,LONGVARBINARY: -4,
		NULL: 0,OTHER: 1111,JAVA_OBREF: 2006,DATALINK: 70,BOOLEAN: 16,ROWID: -8,
	    NCHAR: -15,NVARCHAR: -9,LONGNVARCHAR: -16,NCLOB: 2011,SQLXML: 2009
	},
	// TableType
	TableType: {
		KEY: 'tableType',
		MONTH: 0,
		WEEK: 1,
		YEAR: 2
	},
	/**
	 * 获取command key
	 * @returns
	 */
	getCmdKey: function(){
		return this.CMDKEY;
	},
	/**
	 * 获取create command
	 * @returns
	 */
	getCreateCmd: function(){
		var cmd = {};
		cmd[this.CMDKEY] = this.CREATE;
		return cmd;
	},
	/**
	 * 获取read command
	 * @returns
	 */
	getReadCmd: function(){
		var cmd = {};
		cmd[this.CMDKEY] = this.READ;
		return cmd;
	},
	/**
	 * 获取update command
	 * @returns
	 */
	getUpdateCmd: function(){
		var cmd = {};
		cmd[this.CMDKEY] = this.UPDATE;
		return cmd;
	},
	/**
	 * 获取delete command
	 * @returns
	 */
	getDeleteCmd: function(){
		var cmd = {};
		cmd[this.CMDKEY] = this.DELETE;
		return cmd;
	},
	/**
	 * 获取load command
	 * @returns
	 */
	getLoadCmd: function() {
		var cmd = {};
		cmd[this.CMDKEY] = this.LOAD;
		return cmd;
	},
	/**
	 * 获取export command
	 * @returns
	 */
	getExportCmd: function() {
		var cmd = {};
		cmd[this.CMDKEY] = this.EXPORT;
		return cmd;
	},
	/**
	 * 获取import command
	 * @returns
	 */
	getImportCmd: function() {
		var cmd = {};
		cmd[this.CMDKEY] = this.IMPORT;
		return cmd;
	},
	/**
	 * 构建参数项
	 * @param oper 操作符
	 * @param val 值
	 * @param type 类型
	 * @returns
	 */
	buildParamItem: function(oper, val, type) {
		var item = {};
		item.operator = oper;
		item.value = val;
		item.type = type;
		return item;
	},
	/**
	 * 构建后端需要格式的参数
	 * @param param 参数对象
	 * @param cdt 值
	 * @returns
	 */
	buildParam: function(param, cdt){
		param[this.PARAMJSONKEY] = JSON2.stringify(cdt);
		return param;
	},
	/**
	 * 构建分页参数
	 * @param param
	 * @param page
	 * @param pageSize
	 */
	buildPagingParam: function(param, page, pageSize){
		param[Param.PAGE] = page;
		if(!pageSize){
			pageSize = 30;
		}
		param[Param.PAGE_SIZE] = pageSize;
		return param;
	},
	/**
	 * 构建TableType参数
	 */
	buildTableTypeParam: function(param, tableType) {
		param[Param.TableType.KEY] = tableType;
		return param;
	}
	
};
/**
 * 图表
 */
var Chart = {
	/**
	 * 获取仪表盘series
	 * @param val 值
	 * @param thrshds 阀值数组
	 * [{MIN_THRSHD: 0,MAX_THRSHD: 4,THRSHD_STTS: 1}
	 * ,{MIN_THRSHD: 4,MAX_THRSHD: 8,THRSHD_STTS: 2}
	 * ,{MIN_THRSHD: 8,MAX_THRSHD: 10,THRSHD_STTS: 3}]
	 */
	getGaugeSeries: function(val, thrshds) {
		var min = 0,max = 365;
		// [[比例,颜色],...]
		var color = [[0.2, '#8bbf3a'],[0.6, '#ffff00'],[1, '#ff0000']];
		if (thrshds && thrshds.length > 0) {
			var d = 0,g = 0;
			$.each(thrshds, function(index, item, ds) {
				if (item && item.THRSHD_STTS) {
					if (parseInt(item.THRSHD_STTS) == 1) {
						if (item.MIN_THRSHD) {
							min = parseFloat(item.MIN_THRSHD).toFixed(2);
						}
					}
					if (parseInt(item.THRSHD_STTS) == 2) {
						d = parseFloat(item.MIN_THRSHD);
						g = parseFloat(item.MAX_THRSHD);
					}
					if (parseInt(item.THRSHD_STTS) == 3) {
						if (item.MAX_THRSHD) {
							max = parseFloat(item.MAX_THRSHD).toFixed(2);
						}
					}
				}
			});
			if (d > 0 && g > 0 && g > d) {
				// 计算比例
				d = (d / max).toFixed(2);
				g = (g / max).toFixed(2);
				color[0][0] = d;
				color[1][0] = g;
			}
		}
		var ss = {
			series: [
				{
		            name: '时间',
		            type: 'gauge',
		            center: ['50%', '83%'],
		            radius: ['100%', '145%'],
		            startAngle: 190,
		            endAngle: -10,
		            min: min,
		            max: max,
		            splitNumber: 3,
		            splitLine: {
		            	show: true,
		            	length: 12,
		            	lineStyle: {
		            		color: 'auto'
		            	}
		            },
		            axisLine: {
		                lineStyle: {
		                	color: color,
			    			width: 12
		                }
		            },
		            axisLabel: {
		            	show: true,
		            	formatter: function(p) {
		            		if (p) {
		            			p = Math.round(Number(p));
		            		}
		            		return p;
		            	},
		            	textStyle: {
		            		color: '#333333'
		            	}
		            },
		            pointer: {
		            	length: '70%',
		            	width: 10,
		            	color: '#cccccc'
		            },
		            axisTick: {show: false},
		            detail: {show: false},
		            title: {show: false},
		            data: [{value: (val ? Number(val) : 0)}]
		        }
		    ]
		};
		return ss;
	}
};

/**
 * 公共方法
 */
var pubFunction = {
		setTime: function(radioValue) {
			if(radioValue==1){//今天
				var cdate = Util.date.format(new Date(), 'yyyy-MM-dd');
				$('#startTime').datebox('setValue', cdate);
				$('#endTime').datebox('setValue', cdate);
			}else if(radioValue==2){//昨天
				var cdate = Util.date.format(new Date(new Date() - 24*60*60*1000), 'yyyy-MM-dd');
				$('#startTime').datebox('setValue', cdate);
				$('#endTime').datebox('setValue', cdate);
			}else if(radioValue==3){//本周
				var cdate = Util.date.format(new Date(), 'yyyy-MM-dd');
				var day=new Date().getDay() - 1; 
				var pdate = Util.date.format(new Date(new Date() - day*24*60*60*1000), 'yyyy-MM-dd');
				$('#startTime').datebox('setValue', pdate);
				$('#endTime').datebox('setValue', cdate);
			}else if(radioValue==4){//上周
				var cdate = Util.date.format(new Date(), 'yyyy-MM-dd');
				var day=new Date().getDay(); 
				var edate = Util.date.format(new Date(new Date() - (day)*24*60*60*1000), 'yyyy-MM-dd');
				var sdate = Util.date.format(new Date(new Date(edate) - 6*24*60*60*1000), 'yyyy-MM-dd');
				$('#startTime').datebox('setValue', sdate);
				$('#endTime').datebox('setValue', edate);
			}else if(radioValue==5){//本月
				var edate = Util.date.format(new Date(), 'yyyy-MM-dd');
				var sdate = edate.substring(0,8)+"01";
				$('#startTime').datebox('setValue', sdate);
				$('#endTime').datebox('setValue', edate);
			}else if(radioValue==6){//上月
				var now = new Date();
				now.setDate(1);
				now.setMonth(now.getMonth() - 1);
				var sdate = Util.date.format(now, 'yyyy-MM-dd');
				var edate = Util.date.format(new Date(now.getFullYear(), now.getMonth() + 1, 0),'yyyy-MM-dd');
				$('#startTime').datebox('setValue', sdate);
				$('#endTime').datebox('setValue', edate);
			}else if(radioValue==7){//本季度
				var edate = Util.date.format(new Date(), 'yyyy-MM-dd');
				var now = new Date();
				var nowMonth = now.getMonth();
				var sdate;
				now.setMonth(now.getMonth() - 1);
				if(nowMonth<3){
					sdate = Util.date.format(new Date(now.getFullYear(), 0, 1), 'yyyy-MM-dd');
				}
				if(2<nowMonth && nowMonth<6){
					sdate = Util.date.format(new Date(now.getFullYear(), 3, 1), 'yyyy-MM-dd');
				}
				if(5<nowMonth && nowMonth<9){
					sdate = Util.date.format(new Date(now.getFullYear(), 6, 1), 'yyyy-MM-dd');
				}
				if(nowMonth>8){
					sdate = Util.date.format(new Date(now.getFullYear(), 9, 1), 'yyyy-MM-dd');
				} 
				$('#startTime').datebox('setValue', sdate);
				$('#endTime').datebox('setValue', edate);
			}else if(radioValue==8){//上季度
				var now = new Date();
				var nowMonth = now.getMonth();
				var sdate;
				var edate;
				now.setMonth(now.getMonth() - 1);
				if(nowMonth<3){
					sdate = Util.date.format(new Date(now.getFullYear()-1, 9, 1), 'yyyy-MM-dd');
					edate = Util.date.format(new Date(now.getFullYear()-1, 12, 31), 'yyyy-MM-dd');
				}
				if(2<nowMonth && nowMonth<6){
					sdate = Util.date.format(new Date(now.getFullYear(), 0, 1), 'yyyy-MM-dd');
					edate = Util.date.format(new Date(now.getFullYear(), 2, 31), 'yyyy-MM-dd');
				}
				if(5<nowMonth && nowMonth<9){
					sdate = Util.date.format(new Date(now.getFullYear(), 3, 1), 'yyyy-MM-dd');
					edate = Util.date.format(new Date(now.getFullYear(), 5, 30), 'yyyy-MM-dd');
				}
				if(nowMonth>8){
					sdate = Util.date.format(new Date(now.getFullYear(), 6, 1), 'yyyy-MM-dd');
					edate = Util.date.format(new Date(now.getFullYear(), 8, 30), 'yyyy-MM-dd');
				} 
				$('#startTime').datebox('setValue', sdate);
				$('#endTime').datebox('setValue', edate);
			}else if(radioValue==9){//今年
				var now = new Date();
				var edate = Util.date.format(new Date(), 'yyyy-MM-dd');
				var sdate = Util.date.format(new Date(now.getFullYear(), 0, 1), 'yyyy-MM-dd');
				$('#startTime').datebox('setValue', sdate);
				$('#endTime').datebox('setValue', edate);
			}
		},
		
		//关闭页面
		CloseWebPage: function() {
			if (confirm("您确定要关闭本页吗？"))
			{
				if (navigator.userAgent.indexOf("MSIE") > 0) {   
			        if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {   
			            window.opener = null; window.close();   
			        }   
			        else {   
			            window.open('', '_top'); window.top.close();   
			        }   
			    }   
			    else if (navigator.userAgent.indexOf("Firefox") > 0) {   
			        window.location.href = 'about:blank '; //火狐默认状态非window.open的页面window.close是无效的  
			        //window.history.go(-2);   
			    }   
			    else {   
			        window.opener = null;    
			        window.open('', '_self', '');   
			        window.close();   
			    }
			}
		},
		
		//打印
		PrintPage: function() {
			document.execCommand("print");
		}
		

};

